package com.demoo.zjsu.service.smartwebsite.zjgsu;

import com.demoo.zjsu.model.smartwebsite.PageOne;

import com.demoo.zjsu.service.smartwebsite.Page;

import org.jsoup.select.Elements;
import org.springframework.stereotype.Service;

/**
 * Created by jshjsh on 2016/8/17.
 * 研究生导师一块
 */
@Service
public class GuideTeacherServcie extends BasePackageFactory{

    @Override
    public Page getPage() {
        Page page = new Page();
        String[] urls = new String[]{"http://www.zjgsu.edu.cn/Channel_54/"};
        String[] category = {"研究生导师"};
        page.setLinkUrls(urls);
        page.setCategories(category);
        return page;
    }


    @Override
    public PageOne getPageOne(Elements e) {
        PageOne pageOne = new PageOne();
        String content = e.toString().replaceAll("<a[^>]*href=[^>]*>", "<p>").replaceAll("^</a[^>]*href=[^>]*>", "</p>");
        pageOne.setContent(content);
        return pageOne;
    }
}
